package org.example.strategypatterndemo.module1.service.impl;

import org.example.strategypatterndemo.module1.service.PromotionStrategy;
import org.springframework.stereotype.Component;

/**
 * DiscountStrategy 打折策略
 * @author dingchen
 * @version 2025/05/29 12:34
**/
@Component
public class DiscountStrategy implements PromotionStrategy {
    @Override
    public double calculateDiscount(double orderAmount) {
        // 打8折，优惠20%
        return orderAmount * 0.2;
    }
}
